#include<stdio.h>
int main(){
	int T,M;
	scanf("%d",&T);
	for(M=1;M<=T;M++){
		int N,n,a[100],g;
		scanf("%d",&N);
		for(n=0;n<N;n++)
		scanf("%d",&a[n]);
		g=a[0]*6+5;
		for(n=0;n<N-1;n++){
			if(a[n]<a[n+1]){
				g=g+(a[n+1]-a[n])*6+5;
			}
			if(a[n]>a[n+1]){
				g=g+(a[n]-a[n+1])*4+5;
			}
		}
		printf("%d\n",g);
	}
	return 0;
} 
